#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>

using namespace std;

int binInsert(int n, int m, int j, int i) {
    // write code here
    m << j;
    return m + n;
}

void Test1()
{
    cout << binInsert(1024, 19, 2, 6);
}

bool is_prime(int n)
{
    for (int i = 2; i <= n / 2; i++)
    {
        if (n % i == 0)
        {
            return false;
        }
    }
    return true;
}

void Test2()
{
    int num = 0;
    cin >> num;
    int num1 = num / 2;
    int num2 = num / 2;
    while (!is_prime(num1) || !is_prime(num2))
    {
        num1--;
        num2++;
    }
    cout << num1 << endl;
    cout << num2 << endl;
}

int main()
{
	Test2();
	return 0;
}